package com.bw.controller;

import com.alibaba.fastjson.JSONObject;
import com.bw.service.TrafficService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class diyishiyong {

    @Autowired
    TrafficService service;
    @RequestMapping("user/finUvCount")
    public List<JSONObject> finUvCount(int chio){
        List<JSONObject> jieshi = service.jieshi(chio);

        ArrayList<String> key = new ArrayList<>();
        ArrayList<String> valu = new ArrayList<>();

        for (JSONObject list : jieshi) {
            key.add(list.getString("ch"));
            valu.add(list.getString("uc_count"));
        }
        System.out.println(key.toString());
        System.out.println(valu.toString());
//        System.out.println(jieshi);
        return jieshi;
    }


//    @RequestMapping("user/jirkouyi")
//    public String jirkouyi(String id){
//
//        return "第几个："+id;
//    }

}
